package com.peihongli.dao;

import com.peihongli.pojo.Worker;
import org.apache.ibatis.annotations.*;

public interface WorkerMapper {
    @Select("SELECT * FROM tb_worker WHERE id = #{id}")
    Worker selectWorker(int id);
    @Insert("INSERT INTO tb_worker(name,age,sex,worker_id)"+"values(#{name},#{age},#{sex},#{worker_id})")
    int insertWorder(Worker worker);
    @Update("UPDATE tb_worker SET name = #{name},age=#{age} "+"WHERE id = #{id}")
    int updateWorker(Worker worker);
    @Delete("DELETE FROM tb_worker where id = #{id}")
    int deleteWorker(int id);

    @Select("SELECT * FROM tb_worker WHERE id = #{param01} AND name = #{param02}")
    Worker selectWorkerByIdAndName(@Param("param01") int id,@Param("param02")String name);

}
